﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using ZCrawler;

namespace ZCrawlerManager
{
    public class Templates
    {
        public static List<ZTemplate> templates;
        public static void Init()
        {
            templates = new List<ZTemplate>();
            if(File.Exists("templates.dat"))
            {
                try
                {
                    templates = ZBinaryWriter.Deserialize<List<ZTemplate>>("templates.dat");
                }
                catch(Exception)
                {}
            }
        }

        public static void Update()
        {
            ZBinaryWriter.Serialize(templates, "templates.dat");
        }
    }
}
